//引入http模块
const http = require("http");

//创建http服务
const server = http.createServer((req, res) => {
  // 获取请求报文数据
  console.log(req.method, req.url, req.headers,'请求方法,请求路径,请求头');
  res.end("<h1>hello word</h1>");
});

//监听端口
server.listen(8090, () => {
  console.log("有人访问啦");
});
